<template>
    <h2>App父级组件</h2>
    <button @click="isShow=!isShow">切换显示</button>
    <child v-if="isShow"></child>
</template> 
<script lang="ts">
import { defineComponent, ref } from 'vue'
import child from './components/child.vue'
export default defineComponent ({
    name: 'App',
    components: {
        child
    },
    setup() {
        const isShow = ref(true)
        return {
            isShow
        }
    }
})

</script>


<style>

</style>